Subtyping, Modular Specification, and Modular Verification for Applicative Object-Oriented Programs
نویسندگان
چکیده
We present a formal specification language and a formal verification logic for a simple object-oriented programming language. The language is applicative and statically typed, and supports subtyping and messagepassing. The verification logic relies on a behavioral notion of subtyping that captures the intuition that a subtype behaves like its supertypes. We give a formal definition for legal subtype relations, based on the specified behavior of objects, and show that this definition is sufficient to ensure the soundness of the verification logic. The verification logic reflects the way programmers reason informally about object-oriented programs, in that it allows them to use static type information, which avoids the need to consider all possible run-time subtypes. We also show that the logic does not require reverification of unchanged code when legal subtypes are added to a program.
منابع مشابه
Behavioral Subtyping is Equivalent to Modular Reasoning for Object-oriented Programs
Behavioral subtyping is an established idea that enables modular reasoning about behavioral properties of object-oriented programs. It requires that syntactic subtypes are behavioral refinements. It validates reasoning about a dynamically-dispatched method call, say E .m(), using the specification associated with the static type of the receiver expression E . For languages with references and m...
متن کاملA Behavioral Subtyping, Specification Inheritance, and Modular Reasoning
Verification of a dynamically-dispatched method call, E .m(), seems to depend on E ’s dynamic type. To avoid case analysis and allow incremental development, object-oriented program verification uses supertype abstraction. That is, one reasons about E .m() using m’s specification for E ’s static type. Supertype abstraction is valid when each subtype in the program is a behavioral subtype. This ...
متن کاملModular Verification of Object-Oriented Programs with Subtypes
Object-oriented programming languages like Smalltalk-80 have a message passing mechanism that allows code to work on instances of many different types. Techniques for the formal specification of such polymorphic functions and abstract types are described, as well as a logic for verifying programs that use message passing but not object mutation or assignment. The reasoning techniques formalize ...
متن کاملBehavioral Subtyping in Object-Oriented Languages
Modularity and code reuse are two important features of object-oriented programming. Modularity means that adding new components does not require reveri cation or respeci cation of existing components. A common form of reuse in objectoriented programs is to add new subtypes to existing types and to invoke already existing procedures with objects of these new types. In such cases, behavior of pr...
متن کاملVerifying Object-Oriented Code Using Object Propositions
The modular verification of object-oriented code is made difficult by the presence of aliasing. If there are multiple clients depending on the properties of an object, one client may break the property that others depend on. Knowledge of both aliasing and predicates allows us to verify whether clients and implementations are compliant with specifications. We have developed a modular verificatio...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2014